﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Base
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请选择你要运算的类型：1.+   2.-   3.x   4./");
            int key = Convert.ToInt32(Console.ReadLine());
            Calculate calculate;
            switch (key)
            {
                case 1:
                    Console.WriteLine("请输入第一个数：");
                    int Numone1= Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo1 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Add(Numone1, Numtwo1, "+");
                    break;
                case 2:
                    Console.WriteLine("请输入第一个数：");
                    int Numone2 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo2 = Convert.ToInt32(Console.ReadLine());
                    calculate = new AddDiff(Numone2, Numtwo2, "-");            
                    break;
                case 3:
                    Console.WriteLine("请输入第一个数：");
                    int Numone3 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo3 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Chengfa(Numone3, Numtwo3, "*");
                    break;
                case 4:
                    Console.WriteLine("请输入第一个数：");
                    int Numone4 = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine("请输入第二个数：");
                    int Numtwo4 = Convert.ToInt32(Console.ReadLine());
                    calculate = new Chufa(Numone4, Numtwo4, "/");
                    break;
                default:
                    calculate = new Add(0, 0, "+");
                    Console.WriteLine("你确实你没选择错？？？");
                    break;
            }
            PublicCalculate publicCalculate = new PublicCalculate();
            publicCalculate.PublicCalculatetest(calculate);
        }
    }
}
